package fr.n7.sma.model.listeners.events;

import fr.n7.sma.model.Agent;


public class GridModelEvent<AgentProperty, CellAdditionnalProperty> {
	
	public enum EventType {CELL_CHANGED, AGENT_CHANGED, AGENT_ADDED, AGENT_REMOVED};
	
	private EventType eventType;
	private CellEvent<CellAdditionnalProperty> cellEvent;
	private AgentEvent<AgentProperty, CellAdditionnalProperty> agentEvent;
	private Agent<AgentProperty, CellAdditionnalProperty> agent;
	
	public GridModelEvent(CellEvent<CellAdditionnalProperty> ce){
		eventType = EventType.CELL_CHANGED;
		this.cellEvent = ce;
	}

	public GridModelEvent(AgentEvent<AgentProperty, CellAdditionnalProperty> event){
		eventType = EventType.AGENT_CHANGED;
		this.agentEvent = event;
	}

	public GridModelEvent(EventType event, Agent<AgentProperty, CellAdditionnalProperty> agent){
		eventType = event;
		this.agent = agent;
	}

	/**
	 * @return the cell event
	 */
	public CellEvent<CellAdditionnalProperty> getCellEvent() {
		return cellEvent;
	}
	
	/**
	 * @return the agent event
	 */
	public AgentEvent<AgentProperty, CellAdditionnalProperty> getAgentEvent() {
		return agentEvent;
	}

	/**
	 * @return the event
	 */
	public EventType getEventType() {
		return eventType;
	}

	public Agent<AgentProperty, CellAdditionnalProperty> getAgent() {
		return agent;
	}
}
